require(['./config'],()=>{
    require(['UT','jquery','header','footer'],()=>{
        class Kefu{
            constructor(){
                this.init()
            }
            init(){
             var top1=my$('.top')[0],
                  inp=my$('input')[0],
                     person=['小姐姐','小哥哥','怪蜀黍','大叔','唐僧洗头用飘柔','海飞丝','张三','李四','王麻子','判官','法官','打官','执行官','玉帝哥哥','女王陛下','手机贴膜','路边摊','kakatou','前进','后退','羽化登仙'],
                     msg=['你好呀','我不好','今晚喝酒去？','不要','为什么','不为什么','信不信我打的你满地找牙','我信你个鬼','你个糟老头子坏的很','无情无义，自私冷酷','你这个造型有点....','呵呵哒','哎呀我的天哪','破鞋楼']
                inp.onkeydown=function(e){
                    e=e||window.event
                    if(e.keyCode === 13){
                 var text = this.value
                 var p=document.createElement('p')
                  p.innerText=text+": 我"
                  p.className='right'
                  top1.appendChild(p)
                 this.value= ''
                 
                var p1=document.createElement('p') 
                 var num1=getRandom(0,person.length-1)
                 var  num2=getRandom(0,msg.length-1)
                 p1.innerText=person[num1]+':'+msg[num2]
                    p1.className='left'
                     top1.appendChild(p1)
                    
                   }
                }
            }
      
        }
        return new Kefu()
    })
})